<template>
	<view>
		<view class="imgbox">
			<image :src="item" v-for="(item,index) in list" :key="index" mode="" @click="yulan(item)">
			</image>
		</view>
	</view>
</template> 

<script>
	import ikz from '@/pages/Common/tools.js';
	export default {
		data( ) {
			return {
				adminImgPath: getApp( ).globalData.adminImgPath,
				list:[
					{Image:'/static/mai/mian.png'}
				],
				id:0
			};
		},
		onLoad(op) {
			this.id = op.id
		},
		onShow() {
			this.getStoreDet( ) 
		},
		methods: {
			yulan( item ) {
				
				uni.downloadFile({
					url: item,
					success: res => {
						if (res.statusCode === 200) {
							uni.previewImage({
								urls: [res.tempFilePath]
							})
						}
					}
				})
			},
			// 获取商家详情
			getStoreDet( ) {
				var path = '/xyb/supermarket/index/business_detail';
				var data = {
					id: this.id
				};
				ikz.requestPost( path, data, res => {
					console.log( "获取商家详情", res )
					if ( res.data.code ) {
						//商家信息
					
						this.list = res.data.data.environment_images
						console.log( this.list, '0000' );
						
					} else {
						uni.showModal( {
							title: '提示',
							content: res.data.msg,
							showCancel: false,
							success: function( res ) {}
						} );
					}
				} )
			},
		},
		
	}
</script>

<style lang="scss">
	.imgbox {
		width: 100%;
		height: 100vh;
		padding: 32rpx 30rpx;
		box-sizing: border-box;
		

		image {
			width: 332rpx;
			height: 332rpx;
			border-radius: 20rpx;
			margin-bottom: 26rpx;
			margin-right: 26rpx;
			
			&:nth-child(2n){
				margin-right: 0;
			}
		}
		
	}
</style>